import { defineStore } from "pinia";

export const useDrawerStore = defineStore('drawer-store', {
  /**
   * 存储全局状态
   * 1.必须是箭头函数: 为了在服务器端渲染的时候避免交叉请求导致数据状态污染
   *
  */
  state: () => ({
    // 选中id
    tableSelectedId: '',
    // 网关id，接口，协议
    gatewayId: '',
    selectedInterface: '',
    selectedProtocol: '',
    // 参数配置title
    formTitle: '',
    formData: {},
    ruleFormLeft: {},
    ruleFormPlc: {},
    RTUForm: {},
    tableData: [],
    mqttForm: {}
  }),
  /**
   * 用来封装计算属性 有缓存功能  类似于computed
   */
  getters: {

  },
  /**
   * 编辑业务逻辑  类似于methods
   */
  actions: {

  }
})
